<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
 	<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-1.4.4.min.js"></script>
 	<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery.ainit-1.0.0.js"></script>
 	<script type="text/javascript" src="${pageContext.request.contextPath}/My97DatePicker/WdatePicker.js"></script>
 	<script type="text/javascript" src="${pageContext.request.contextPath}/homepages/js/forms.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath}/homepages/js/functions.js"></script>
	<script type="text/javascript">
		function addUser251(){
			var configs = new Array();
			configs[0] = $('#test').val();//如果不需要传的参数，则用‘-’横线占位
			configs[1] = '55';
			configs[2] = '1';
			var procConfigs = new Array();
			procConfigs[0] = $('#name').val();//如果不需要穿传的参数，则用‘-’横线占位
			procConfigs[1] = $('#age').val();
			procConfigs[2] = '-';
			
			$.ajax({
				url:'${pageContext.request.contextPath}/butScript/butClick',
				type:'post',
				data:{'sqlParams':parseParams(configs),'butId':'testId','procParams':parseParams(procConfigs)},
				success:function(data){
					alert(data.info);
				}
			}); 
		}
		
		function addUser(){
			var configs = new Array();
			configs[0] = $('#ida').val();//如果不需要传的参数，则用‘-’横线占位
			configs[2] = $('#namea').val();
			configs[1] = $('#agea').val();
		alert(parseParams(configs));
			var butId='addUser';
			var procParams="00";
		saveAll(configs,butId,procParams);
		}
		
		
		function saveAll(configs,butId,procParams){
			$.ajax({
				url:'${pageContext.request.contextPath}/butScript/butClick',
				type:'post',
				data:{'sqlParams':parseParams(configs),'butId':butId,'procParams':procParams},
				success:function(data){
					alert(data.info);
				}
			}); 
		}
		
		String.prototype.replaceDH=function(){
			return this.replace(/\,/g, "^^");
		}
		
function parseParams(arr){
		for(var i = 0; i < arr.length; i++){
			arr[i] = arr[i].toString().replaceDH();
		}
		return arr.toString();
}
	</script>
</head>
<body>
	ID:<input id='ida' ><br/>
	姓名：<input id="namea"><br/>
	年龄：<input id="agea"><br/>
	<input type="button" onclick="addUser()" value="更新用户信息">
	
	
</body>
</html>